package com.lrs.s2sh.web.jsonUtils;

import net.sf.json.JSONFunction;

public class JSONFunctionConvert extends JSONFunction {

	private static final long serialVersionUID = -689906332274633183L;
	private boolean isCustomeFmtter;
	
	public JSONFunctionConvert(String text, boolean isCustomeFmtter) {
		super(text);
		this.isCustomeFmtter = isCustomeFmtter;
	}

	@Override
	public String toString() {

		StringBuffer b = new StringBuffer();
		if (getText().length() > 0) {
			if (isCustomeFmtter) {
				b.append(' ').append(getText()).append(' ');
			} else {
				b.append("\"").append(getText()).append("\"");
			}
		}
		return b.toString();
	}

}
